{% extends '_base.html' %}

{% block layout %}
	{% set __sidebar_left__ = true %}
{% endblock %}

{% block nav %} /none {% endblock %}

{% block title %}{{ user.name }}{% endblock %}

{% block meta %}
    <meta property="og:type" content="webpage" />
    <meta property="og:url" content="{{ __url__ }}" />
    <meta property="og:title" content="{{ user.name }}" />
{% endblock %}

{% block head %}

<style>
.x-user-visible {
    display: block;
}
</style>

{% endblock %}

{% block sidebar_left_content %}
    <h3>{{ user.name }}</h3>
    <div class="uk-clearfix">
        <img src="{{ user.imageUrl }}" class="uk-comment-avatar uk-border-circle x-avatar" style="width:100px;height:100px">
    </div>

    <h3 class="uk-margin-top">{{ _('Registration Date') }}</h3>
    <p><span class="x-smart-datetime" data="{{ user.createdAt }}"></span></p>
{% endblock %}

{% block content %}

    <table class="uk-table uk-table-hover">
        <thead>
            <tr>
                <th>
                	{{ _('Recent Posts') }}
                	<span class="x-can-delete">
                		[<a href="javascript:deleteTopics($('.x-topic-id').map(function(){return $(this).text()}).get())" class="uk-text-danger">{{ _('Delete All') }}</a>]
                		[<a href="javascript:deleteTopicsAndLockUser($('.x-topic-id').map(function(){return $(this).text()}).get(), '{{ user.id }}')" class="uk-text-danger">{{ _('Delete All and Lock User') }}</a>]
                	</span>
                </th>
            </tr>
        </thead>
        <tbody>
        {% for t in topics %}
            <tr>
                <td>
                	<div class="x-topic-id uk-hidden">{{ t.id }}</div>
                    <a href="/user/{{ user.id }}" target="_blank"><img class="uk-comment-avatar uk-border-circle x-avatar" src="{{ user.imageUrl }}" style="width:50px;height:50px"></a>
                    <div style="margin-left:70px;">
                        <div class="uk-margin" style="font-size:16px;"><a href="/discuss/{{ t.boardId }}/{{ t.id }}">{{ t.name }}</a></div>
                        <div>
                            <a href="/user/{{ user.id }}" target="_blank">{{ user.name }}</a> {{ _('posted at') }} <span class="x-smart-datetime" data="{{ t.createdAt }}">...</span>
                            {% if t.updatedAt > t.createdAt %}
                            {{ _('Last replied at') }} <span class="x-smart-datetime" data="{{ t.updatedAt }}">...</span>
                            {% endif %}
                        </div>
                    </div>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <!-- <h3>{{ _('Recent Replies') }}</h3> -->

{% endblock %}
